package map;

import java.util.HashMap;
import java.util.Map;

public class MapDemo1 {
    public static void main(String[] args) {
        Map<String,Integer> map = new HashMap<>();
        Integer value = map.put("语文",99);
        map.put("数学",98);
        map.put("英语",97);
        map.put("物理",96);
        map.put("化学",95);
        System.out.println(map);
        value = map.put("语文",66);
        System.out.println(value);
        System.out.println(map);

        value = map.get("语文");
        System.out.println(value);
        value = map.get("体育");
        System.out.println(value);

        int size = map.size();
        System.out.println("siaz:"+size);

        value = map.remove("数学");
        System.out.println(value);
        System.out.println(map);

        boolean isEmpty = map.isEmpty();
        System.out.println("是否为空Map:"+isEmpty);

        boolean cv = map.containsKey("英语");
        System.out.println(cv);
        cv = map.containsKey("体育");
        System.out.println(cv);

        boolean ck = map.containsValue(97);
        System.out.println(ck);
        ck = map.containsValue(80);
        System.out.println(ck);

        map.clear();
        System.out.println(map);
    }
}
